<template>
  <div>
    <div class="hade">
      <div @click="add"><van-icon name="arrow-left" class="icon" /></div>
      <div class="input">
        <van-icon name="arrow-down" class="newicon"/>
        <input type="text" placeholder="请输入小区或地区">
      </div>
      <van-icon name="location-o" class="icon"/>
    </div>
    <!-- 下拉菜单 -->
      <div class="caidan">
        <van-dropdown-menu>
    <!-- <van-dropdown-item v-model="value" :options="option" /> -->
    <van-dropdown-item title="筛选" ref="item">
      <van-cell center title="包邮">
        <template #right-icon>
          <van-switch v-model="switch1" size="24" active-color="#ee0a24" />
        </template>
      </van-cell>
      <van-cell center title="团购">
        <template #right-icon>
          <van-switch v-model="switch2" size="24" active-color="#ee0a24" />
        </template>
      </van-cell>
      <div style="padding: 5px 16px;">
        <!-- <van-button type="danger" block round @click="onConfirm">
          确认
        </van-button> -->
      </div>
     </van-dropdown-item>
     </van-dropdown-menu>
      </div>

      <div class="body" v-for="(item,index) in list" :key="index" @click="add1(item.houseCode)">
        <div class="img"><img :src="'http://121.199.51.160:8080'+item.houseImg"  alt=""></div>
        <div class="text">
          <span class="one"><strong>{{ item.title }}</strong></span><br>
          <span class="two">{{ item.desc }}</span><br>
          <span class="three">{{ item.tags }}</span><br>
          <span class="four">{{ item.price }}</span> <span class="five">/每月</span>
        </div>
      </div>
  </div>
</template>

<script>
export default {
  name: 'ShOw',

  data () {
    return {
      list: ''
    }
  },
  async created () {
    const { data } = await this.$http.get('houses')

    this.list = data.body.list
    console.log(this.list)
  },
  mounted () {

  },

  methods: {
    add () {
      this.$router.push('/shouye')
      console.log(123)
    },
    add1 (id) {
      this.$router.push(`/show/${id}`)
    }
  }
}
</script>

<style  scoped>
.hade{
  display: flex;
  width: 100%;
  height: 50px;
  background-color: #4fc08d;
  padding: 10px 0 10px 20px;
  box-sizing: border-box;
}
.hade .input{
  width: 260px;
  height: 30px;
  background-color: white;
  padding-top: 5px;
  box-sizing: border-box;
  margin-right: 15px;
}
.hade .input input{
  border: none;
  color: #999;
  font-size: 14px;
}
.icon{
  transform: scale(1.5);
  color: white;
  margin: 8px 10px 0 0;
}
.newicon{
  margin: 0 15px 0 15px;
  color: #666;
}
.body{
  box-sizing: border-box;
  margin: 15px ;
  display: flex;
  width: 350px;
  height: 120px;
  border-bottom: 1px solid #999;
}
.img img{
  width: 110px;
  height: 90px;
  margin-right: 20px;
}

.body .text{
  width: 210px;
  height: 100px;
}
.text .one{
  color: black;
}
.text .two{
  color: #666;
  font-size: 14px;
}
.text .three{
  color: #e1f5f8;
  background-color: #4cc6d3;
  font-size: 14px;
}
.text .four{
  color: red;
  font-size: 25px;
}
.text .five{
  color: red;
  font-size: 14px;
}
</style>
